-
-
Couldn't load subscription status.
- Fork 6.2k
Refactor CatFile batch implementation and introduce batch-command for git 2.36 #34651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f0b6480 to
334eb9e
Compare
… into lunny/catfile_batch_refactor
|
Saw many flaky tests: |
81fefd8 to
f09c8a1
Compare
|
It seems that the similar failures also occur in old changes (before my refactoring), for example:
The code before this PR uses two separate processes, so the "readers" won't conflict. But this PR's approach uses only one process, "contents" and "info" share the same reader, it is very fragile, and if it is abused, then deadlock. Just a guess. |
f09c8a1 to
3e5b6c3
Compare
|
Maybe we can merge the two methods, Write and GetReader, into a single function and introduce an internal lock mechanism to prevent potential concurrency issues. |
aea9e48 to
039fa34
Compare
039fa34 to
d8997a3
Compare
1c54fb5 to
c554e85
Compare
c554e85 to
f4ec9d9
Compare

For git version 2.36,
git cat-file --batch-commandwas introduced which can replacegit cat-file --batchandgit cat-file --batch-check.This PR implements an abstract layer for the batch commands so that both git 2.36 and lower version git can work.
If git version is lower than 2.36, it will start two subprocesses
git cat-file --batchandgit cat-file --batch-check.If git version is greater than 2.36, only
git cat-file --batch-commandwill be started.This reduced half of child processes of git catfiles.